//index.js
//获取应用实例
const app = getApp()

Page({
  data: {
    taskList:[]
  },
  onLoad: function () {
      var self = this;
        wx.request({
            url:app.globalData.prefix+"/taskAction/taskHallList.do?openId="+app.globalData.userInfo.openId,
            header:{
               // "Content-Type":"application/json"
            },
            success:function(res){
                console.log(res.data.result);
                self.setData({
                taskList: res.data.result
              });
            },
            fail:function(err){
                console.log(err)
            }
        })
  },
  onShow:function(){
    this.onLoad();
  },
  goDetaily(e) {
    let id = e.currentTarget.dataset.id
    wx.navigateTo({
      url: '../taskDetaily/taskDetaily?taskId='+id,
    })
  }
})


function dealData(taskList){
  console.log();
  self.setdata({
    taskList: [
      {
        title: '网络公司logo设计1',
        type: '美工设计类1',
        level: '等级：初级1',
        people: '51人接取',
        downShelf:'31小时候后下架'
      },
      {
        title: 'logo设计',
        type: '美工设计类',
        level: '等级：高级',
        people: '1人接取',
        downShelf:'2小时候后下架'
      }
    ]
  });
}